package com.smarthome.api.mobile.service;

import java.util.List;

import javax.annotation.Resource;

import com.smarthome.common.mobile.Service;
import com.smarthome.core.operationservicemanager.CompanyExpressService;
import com.smarthome.domain.mobile.MobileCodeEnum;
import com.smarthome.domain.mobile.MobileRequest;
import com.smarthome.domain.mobile.MobileResponse;
import com.smarthome.domain.vo.boss.Combobox;

/**
 * 
* @ClassName: MobileCompanyExpressService
* @Description: 移动端快递点接口
* @author cyj
* @date 2016年4月6日 下午9:18:57
*
 */
@org.springframework.stereotype.Service("mobile.companyExpress.service")
public class MobileCompanyExpressService implements Service<MobileResponse<?>> {

	
	@Resource
	private CompanyExpressService companyExpressService;
	
	
	
	/**
	 * 
	* @Title: getCombobox 
	* @Description: 获取当前小区关联的快递点下拉框 
	* @param request
	* @param response
	* void
	* @throws 
	* @author cyj
	 */
	public void getCombobox(MobileRequest request,MobileResponse<List<Combobox>> response) {
		if(request.getAccount().getResidenceId() == null) {
			response.setMobileCodeObj(MobileCodeEnum.EXPRESS_NOT_RESIDENCE);
			return;
		}
		try {
			List<Combobox> result = companyExpressService.getCombobox(request.getAccount().getResidenceId());
			response.setData(result);
		}catch(Exception e) {
			response.setMobileCodeObj(MobileCodeEnum.SYSTEM_ERROR);
		}
		
	}
}
